<div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
    <h4 class="modal-title" id="ntModalLabel">{:strtoupper(lang('add/change_bank'))}</h4>
</div>
<form class="modal-body formbox">
        <div class="row clearfix">
                <div class="col-md-12 column">
                    <div class="alert alert-dismissable alert-info">
                        <button type="button" class="close">×</button>
                         <p></p>
                    </div>
                </div>
            </div>
    <table class="table table-striped table-hover ntTable">
        <tbody>
        <tr>
            <td class="col-md-2">{:strtoupper(lang('country'))}<span class="required"></span></td>
            <td>
                <select class="form-control col-md-2" name="country_id">
                    <option value="">{:lang('please_select')}</option>
                    {volist name="country" id="vo"}
                    {eq name="vo.id" value="$info.country_id|default=''"}
                    <option value="{$vo.id}" selected>{$vo.name}</option>
                    {else/}
                    <option value="{$vo.id}">{$vo.name}</option>
                    {/eq}
                    {/volist}
                </select>
            </td>
        </tr>
        <tr>
            <td class="col-md-2">{:strtoupper(lang('bank_name'))}<span class="required"></span></td>
            <td>
                <input type="text" class="form-control" placeholder="{:lang('bank_name')}" name="name" value="{$info.name|default=''}">
            </td>
        </tr>
        <tr>
            <td class="col-md-2">{:strtoupper(lang('bank_abbreviation'))}<span class="required"></span></td>
            <td>
                <input type="text" class="form-control" placeholder="{:lang('bank_abbreviation')}" name="shortname"
                       value="{$info.shortname|default=''}">
            </td>
        </tr>
        <tr>
            <td class="col-md-2">{:strtoupper(lang('bank_code'))}<span class="required"></span></td>
            <td>
                <input type="text" class="form-control" placeholder="{:lang('bank_code')}" name="code" value="{$info.code|default=''}">
            </td>
        </tr>
        </tbody>
    </table>
    <input type="hidden" id="act" name="act" value="{$str}">
    <input type="hidden" name="id" id="id" value="{$info.id|default=''}">
</form>
<div class="modal-footer">
    <button type="button" class="btn btn-default" data-dismiss="modal"><span class="glyphicon glyphicon-remove"></span>{:strtoupper(lang('cancel'))}
    </button>
    <button type="button" id="quedin" class="btn btn-primary" style="padding-left:24px;padding-right:24px"><span
            class="glyphicon glyphicon-floppy-disk"></span>{:strtoupper(lang('save'))}
    </button>
</div>
<script>
    //数据的提交
    $('#quedin').click(subfn)
    var addbm = true;
    function subfn() {
        if (addbm) {
            $.ajax({
                url: '/Admin/prefecture/' + $('#act').val(),
                type: 'post',
                data: $(".formbox").serialize(),
                dataType: 'json',
                success: function (res) {
                    if (res.status != 1) {
                        change_mes_type('.modal-body .alert',res.status)
                        $('.modal-body .alert').show()
                        $('.modal-body .alert p').html('*'+res.msg+'<br>')
                    } else {
                        change_mes_type('#headeralert',res.status)
                        addbm = false
                        $('#headeralert').show()
                        $('#headeralert p').html('*'+res.msg+'<br>')
                        $('#banks_editModal').modal('hide')
                    }
                }
            });
        }
    }
    //渲染所属部门的数据
    $(document).keydown(function (event) {
        if (event.keyCode == 13) {
            $('form').each(function () {
                event.preventDefault();
            });
            subfn()
        }
    });
</script>